<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>textcasing</title>
	
	<script type="text/javascript" src="sendsmsworld.js"></script>
	
	<script type="text/javascript" charset="utf-8">
    // Função responsável por inserir linhas na tabela
    function inserirLinhaTabela(id, myArray) {

        // Captura a referência da tabela com id “minhaTabela”
        var table = document.getElementById(id);
        // Captura a quantidade de linhas já existentes na tabela
        var numOfRows = table.rows.length;
        // Captura a quantidade de colunas da última linha da tabela
        var numOfCols = table.rows[numOfRows-1].cells.length;

		if (numOfCols != myArray.length) throw new Error(500, "quantidade de parametros errada" );
        // Insere uma linha no fim da tabela.
        var newRow = table.insertRow(numOfRows);
	
        // Faz um loop para criar as colunas
        for (var j = 0; j < numOfCols; j++) {
            // Insere uma coluna na nova linha 
            newCell = newRow.insertCell(j);
            // Insere um conteúdo na coluna
            newCell.innerHTML = myArray[j];
        }

    }

	send = function () {

	var parameters = Schema.getAAttr("sendSMS");
	parameters.getAAttr("FromEmailAddress").setValue("gabriel@joao.com");
	parameters.getAAttr("CountryCode").setValue("55");
	parameters.getAAttr("MobileNumber").setValue("2188011030");
	parameters.getAAttr("Message").setValue("teste");  
//1ª		
//	var teste = new Elements();
//	Schema.getAAttr("InvertStringCase").getAAttr("sAString").setValue(document.getElementById("TextCasingText").value);
//	alert(Schema.getAAttr("InvertStringCase").getAAttr("sAString").getValue());
//2a
//	Elements.schema.getAAttr("InvertStringCase").getAAttr("sAString").setValue(document.getElementById("TextCasingText").value);
//	alert(Elements.schema.getAAttr("InvertStringCase").getAAttr("sAString").getValue());
			
	SendSMSWorld.SendSMSWorldSoap.sendSMS (parameters, sendResponse);
	}		
	
	sendResponse = function (parameters) {
		myArray = [];
		myArray.push(parameters.getAAttr("sendSMSResult").getValue());
		inserirLinhaTabela("TextCasingTable", myArray);
	}
	
	</script>
	
</head>

<body>
	<form action="" accept-charset="utf-8">
		<fieldset>
			<input type="text" name="TextCasingText" value="" id="TextCasingText"/>	
			<input type="button" value="Continue &rarr;" onclick="send()"/>		
		</fieldset>

		
	</form>

	<div class="TextCasingConteudo">
		<table id="TextCasingTable" border="1">
		
				<tr>
					<th>InvertStringCaseResult</th>
				</tr>	
		</table>
	</div>	
	
</body>
</html>